<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
    <?php

    date_default_timezone_set('Asia/Jakarta');
    $this->fpdf->FPDF("L","cm","A4");
    $this->fpdf->SetMargins(1,1,1);
    $this->fpdf->AliasNbPages();
    $this->fpdf->AddPage();
    $this->fpdf->SetFont('Times','B',12);
    $this->fpdf->Cell(0,0,'LAPORAN SANTRI BARU',0,0,'C');
    $this->fpdf->Ln(0.5);
    $this->fpdf->SetFont('Times','B',16);
    $this->fpdf->Cell(0,0,'Pesantren Zainul Hasan Genggong',0,0,'C');
    $this->fpdf->Ln(0.7);
    $this->fpdf->Ln();
    $this->fpdf->SetFont('Times','i',11);
    $this->fpdf->Cell(10, 0.5, 'Priode PSB : '.date('Y'),0,'LR','L');
    $this->fpdf->Ln(0.5);
    $this->fpdf->Cell(10, 0.5, 'Dicetak Pada : '.date('d/m/Y H:i'),0,'LR','L');
    $this->fpdf->Ln(0.5);
    
    $this->fpdf->SetFont('Times','B',12);
    $this->fpdf->SetTextColor(190,30,115);
    $this->fpdf->Cell(2, 1, 'ID' , 1, 'LR', 'L');
    $this->fpdf->Cell(4.3 , 1, 'Nama' , 1, 'LR', 'L');
    $this->fpdf->Cell(6, 1, 'Lembaga' , 1, 'LR', 'L');
    $this->fpdf->Cell(2.4 , 1, 'Pebayaran' , 1, 'LR', 'L');
    $this->fpdf->Cell(2.7 , 1, 'Dokumen' , 1, 'LR', 'L');
    $this->fpdf->Cell(3, 1, 'Tes' , 1, 'LR', 'L');
    $this->fpdf->Cell(3.4 , 1, 'Status' , 1, 'LR', 'L');
    $this->fpdf->Cell(3.9 , 1, 'Tgl Daftar' , 1, 'LR', 'L');
    foreach($hasil as $data)
    {
        $sekolah=$data->id_sekolah;
  $s2=$this->admin_model->getNamaSekolahById($sekolah);
    $this->fpdf->Ln();
    $this->fpdf->SetTextColor(0,0,0);
    $this->fpdf->SetFont('Times','',11);
    $this->fpdf->Cell(2, 0.7, $data->id_santri_baru , 1, 'LR', 'L');
    $this->fpdf->Cell(4.3 , 0.7, $data->nama_lengkap , 1, 'LR', 'L');
    $this->fpdf->Cell(6, 0.7, $s2['nama'] , 1, 'LR', 'L');
    $this->fpdf->Cell(2.4 , 0.7, $data->pembayaran , 1, 'LR', 'L');
    $this->fpdf->Cell(2.7 , 0.7, $data->dokumen_lengkap , 1, 'LR', 'L');
    $this->fpdf->Cell(3, 0.7, $data->tes_lembaga , 1, 'LR', 'L');
    $this->fpdf->Cell(3.4 , 0.7, $data->status , 1, 'LR', 'L');
    $this->fpdf->Cell(3.9 , 0.7, $data->tgl_reg , 1, 'LR', 'L');
    }
    $this->fpdf->Ln(1.5);
    $this->fpdf->SetFont('Times','',12);
    $this->fpdf->Cell(9.5, 0.5, 'Pembuat Laporan,',0,'LR','L');
    $this->fpdf->Ln(2);
    $this->fpdf->SetFont('Times','B',12);
    $this->fpdf->Cell(9.5, 0.5,$nama_user,0,'LR','L');
        

    /* generate pdf jika semua konstruktor, data yang akan ditampilkan, dll sudah selesai */
    $this->fpdf->Output("laporan_santri.pdf","I");
    ?>
